*** Settings ***
Resource          ../Keywords/公共/公共关键字2.0.robot
Resource          ../Resources/Global_Variables.robot
Library           DateTime
Library           RequestsLibrary
Library           Collections

*** Test Cases ***
获取check参数（鉴权管理访问凭证）
    # 获取当前时间的日、时、分并格式化为两位数
    ${current_day}=    Get Current Date    result_format=%d
    ${current_hour}=    Get Current Date    result_format=%H
    ${current_minute}=    Get Current Date    result_format=%M
    # 构建原始密码字符串
    ${original_passwd}=    Set Variable    TT${current_day}SS${current_hour}MM${current_minute}
    # 计算MD5加密值
    ${md5_passwd}=    Evaluate    hashlib.md5('${original_passwd}'.encode()).hexdigest()    modules=hashlib
    # 发送GET请求（示例地址需替换）
    # 修正重复的http://
    Create Session    walle    http://39.156.3.47:19000
    ${response}=    发送Get请求    ${host}    /ugc-server/walle/manager/license/console/login    params=passwd=${md5_passwd}
    ${check_value}=    Get Substring    ${response.text}    0
    Set Global Variable    ${CHECK_GLOBAL}    ${check_value}
    # 验证响应状态码（可选）
    Should Be Equal As Integers    ${response.status_code}    200
    # 打印提取的check值
    Log    ${check_value}
    # 也可以打印全局变量的值
    Log    ${CHECK_GLOBAL}
